<?php
defined('SYS_RUN') or exit();

abstract class ADb {

    private $_managers = array(
        'mongo',
        'storage'
    );

    static $_instance = array();

    function __get($name) {
        if(in_array($name, $this->_managers)) {
            if(!isset(self::$_instance[$name]))
                self::$_instance[$name] = Lib::get('database')->getConnection($name);
            return self::$_instance[$name];
        }
    }
}